package com.scau.controller;

import com.scau.common.message.ResponseMessage;
import com.scau.common.util.MessageUtil;
import com.scau.entity.LectureRecord;
import com.scau.service.LectureRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("lectureRecords")
public class LectureRecordController {

    @Autowired
    private LectureRecordService lectureRecordService;

    @RequestMapping(value = "leave", method = RequestMethod.POST)
    public ResponseMessage<LectureRecord> askForLeave(@RequestBody LectureRecord lectureRecord) {

        lectureRecordService.askForLeave(lectureRecord);

        return MessageUtil.getSuccessMessage();
    }
}
